#ifndef typedefH
#define typedefH

/****************************************************************************************************/
 typedef unsigned int   uint;
 typedef unsigned long  ulng;
 typedef unsigned short usht;
/*##################################################################################################*/

typedef struct{
	char year;
	char mnth;
	char date;
	char hour;
	char min;
	char sec;
}DataTime;

typedef struct{
	char yy;
	char mm;
	char dd;
	char hh;
	char min;
	char sec;
}ArchData;

typedef struct{
	uint err;
	DataTime Time;
	float VbT;
	float Vo;
	float p;
	float T;
}EKdata;

typedef struct{
	uint err;
	float CO2val;
	float Pbar;
	float Rhoc;
	float N2val;
}GASpassport;

typedef struct{
	float Q;
	float T;
	float P;
	float Qsum;
	DataTime Time;
	usht Err;
}GFGdata;

typedef struct{
	float Q;
	float T;
	float P;
	ArchData AD;
	usht Err;
}GFGarch;

typedef struct{
	float K;
	float Vr;
	float Vc;
	float T;
	float P;
	ArchData AD;
	usht Err;
}FBarch;

 #define AINChMax      8
 #define DINChMax      8
 
 typedef struct 
  {
    char Nmean;
    usht ChPwrDelay[AINChMax];
    usht ChPwrType;
    usht ChMeas;
    usht ChPwrMod1;
    usht ChPwrMod2;
    usht MeasDelay;
  }AINsetting;
/////////////////////////////////////////////////////////////
 typedef struct 
  {
    usht DIchTyp;
    usht EdgeTyp;
    usht DIchRst;
    usht ChPwrType;
    usht ChMeas;
    usht ChPwrMod1;
    usht ChPwrMod2;
    usht MeasDelay;
    usht PwrOnDelay;
  }DINsetting;
 
 
 
 
/****************************************************************************************************/
 
/****************************************************************************************************/
 #define ENI         ( __enable_interrupt()  )
 #define DISI        ( __disable_interrupt() )
 #define NOP         ( __no_operation()      )
 #define YES           1U
 #define NO            0U
 #define EN            1U
 #define DIS           0U
 #define MIN(A,B)        ( A<B ? A : B)
 #define MAX(A,B)        ( A>B ? A : B)
/*##################################################################################################*/

 
 
#endif